package com.green.business.controller;

import com.green.business.domain.Salesback;
import com.green.business.mapper.SalesbackMapper;
import com.green.business.service.GoodsService;
import com.green.business.service.SalesbackService;
import com.green.business.service.ProviderService;
import com.green.business.vo.SalesbackVo;
import com.green.system.common.ActiveUser;
import com.green.system.common.ResultObj;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Green
 * @Date: 2021/10/22/16:31
 * @Description:
 */

@RequestMapping("salesback")
@RestController
public class SalesBackController {

    @Autowired
    private SalesbackService salesbackService ;

    @Autowired
    private SalesbackMapper salesbackMapper;

    @Autowired
    private GoodsService goodsService;

    @Autowired
    private ProviderService providerService;

    /**
     * 查询
     */
    @RequestMapping("loadAllSalesback")
    public Object loadAllSalesback(SalesbackVo salesbackVo){
        return this.salesbackService.queryAllSalesback(salesbackVo);
    }

    /**
     * 添加退货信息
     */
    @RequestMapping("addSalesBack")
    public ResultObj addSalesBack(SalesbackVo salesbackVo){
        try{

            this.salesbackService.saveSalesback(salesbackVo);
            return ResultObj.SALESBACK_SUCCESS;
        }catch (Exception e){
            e.printStackTrace();
            return ResultObj.SALESBACK_ERROR;
        }

    }


}
